extension NumStrEx on int {
  String toIntString(int count) {
    var str = toString();
    return List.filled(count - str.length, '0').join('') + str;
  }
}

extension NumEx on num {
  String get progress {
    return '${(this * 100).toInt()}%';
  }

  String get fileSize {
    List<String> unitArr = ['B', 'K', 'M', 'G'];
    int index = 0;
    var value = this;
    while (value > 1024) {
      index++;
      value = value / 1024;
    }
    String size = index > 0 ? value.toStringAsFixed(2) : value.toString();
    return size + unitArr[index];
  }
}

extension ChineseIntEx on int {
  String get ch {
    switch (this) {
      case 1:
        return '一';
      case 2:
        return '二';
      case 3:
        return '三';
      case 4:
        return '四';
      case 5:
        return '五';
      case 6:
        return '六';
      case 7:
        return '七';
      case 8:
        return '八';
      case 9:
        return '九';
      case 10:
        return '十';
      default:
        return '';
    }
  }

  
}
